Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend TealAppDriver$active_module_element() method with new hash parameter #1150

Closed
wants to merge 24 commits into from

Conversation

m7pr
Copy link
Contributor

@m7pr m7pr commented Mar 13, 2024

Part of #503

This is here only temporary. We might decide that tests for {teal.widgets} should leave in {teal.widgets} package repository.

@m7pr m7pr added the core label Mar 13, 2024
@m7pr m7pr changed the base branch from main to 503-introduce-shinytest2@main March 13, 2024 11:02
Base automatically changed from 503-introduce-shinytest2@main to main March 18, 2024 12:05
@vedhav vedhav changed the base branch from main to 503-introduce-shinytest2@main March 18, 2024 12:41
@vedhav vedhav changed the base branch from 503-introduce-shinytest2@main to main March 18, 2024 12:42
@vedhav vedhav changed the base branch from main to 503-introduce-shinytest2@main March 18, 2024 12:44
@vedhav vedhav changed the base branch from 503-introduce-shinytest2@main to main March 18, 2024 12:44
@vedhav vedhav changed the base branch from main to 503-introduce-shinytest2@main March 18, 2024 12:45
@vedhav vedhav force-pushed the teal.widgets@503-introduce-shinytest2@main branch from b5e86d3 to 6e168f9 Compare March 18, 2024 12:48
@vedhav vedhav changed the base branch from 503-introduce-shinytest2@main to main March 18, 2024 12:48
@m7pr m7pr changed the title 503 shinytest2 for {teal.widgets} 503 shinytest2 for teal.widgets::table_with_settings and teal.widgets::verbatim_popup Mar 21, 2024
@m7pr m7pr marked this pull request as ready for review March 21, 2024 14:10
@m7pr
Copy link
Contributor Author

m7pr commented Mar 21, 2024

Hey @vedhav and @averissimo I decided to stop this PR on implementing tests for 2 requested initially functions (our of 4). I think I'm in the place where an extra pair of eyes would be appreciated.

  1. For the first test I am unable to pass variables to the teal app during the creation - would appreciate if you have any thoughts on this.
  2. For the second test I left few TODO - need help comments, where I'm struggling. Maybe you have any wise ideas.

Copy link
Contributor

github-actions bot commented Mar 21, 2024

badge

Code Coverage Summary

Filename                          Stmts    Miss  Cover    Missing
------------------------------  -------  ------  -------  --------------------------------------------------------------------------------------------------------------------------------------------------
R/dummy_functions.R                  36      25  30.56%   21-37, 40-47
R/get_rcode_utils.R                  31       1  96.77%   50
R/include_css_js.R                   22      17  22.73%   12-38, 76-82
R/init.R                             86      31  63.95%   108-115, 161-162, 164, 176-197, 228-229, 231
R/landing_popup_module.R             25      25  0.00%    61-87
R/module_bookmark_manager.R         158     125  20.89%   42-43, 57-59, 70-83, 93-143, 148-149, 189, 224-301
R/module_filter_manager.R            84      19  77.38%   38-42, 157, 162-175
R/module_nested_tabs.R              161      60  62.73%   39-112, 128, 180, 202, 224, 232, 236
R/module_snapshot_manager.R         241     178  26.14%   95-107, 136-139, 143-144, 159-169, 173-188, 190-198, 205-220, 224-228, 230-236, 239-252, 255-273, 282-298, 313-336, 339-350, 353-359, 373, 394-418
R/module_tabs_with_filters.R         76      33  56.58%   33-68, 100, 116
R/module_teal_with_splash.R         114      34  70.18%   60-95, 110, 131, 197-198
R/module_teal.R                     110      76  30.91%   52-119, 150-151, 157, 168, 181-212
R/module_wunder_bar.R                60      39  35.00%   23-41, 55-64, 68-77
R/modules.R                         159      26  83.65%   127-130, 147-151, 206-209, 291-292, 344, 356-364, 418-421
R/reporter_previewer_module.R        19       2  89.47%   30, 34
R/show_rcode_modal.R                 19      19  0.00%    17-36
R/tdata.R                            53       1  98.11%   154
R/teal_data_module-eval_code.R       27       0  100.00%
R/teal_data_module-within.R           7       0  100.00%
R/teal_data_module.R                  6       0  100.00%
R/teal_reporter.R                    62       5  91.94%   69, 118-119, 122, 139
R/teal_slices-store.R                29       0  100.00%
R/teal_slices.R                      59      12  79.66%   137-150
R/TealAppDriver.R                   265     265  0.00%    43-557
R/utils.R                           173       1  99.42%   255
R/validate_inputs.R                  32       0  100.00%
R/validations.R                      58      37  36.21%   110-377
R/zzz.R                              12       8  33.33%   3-15
TOTAL                              2184    1039  52.43%

Diff against main

Filename             Stmts    Miss  Cover
-----------------  -------  ------  --------
R/TealAppDriver.R       +2      +2  +100.00%
TOTAL                   +2      +2  -0.05%

Results for commit: 9a23c3c

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

github-actions bot commented Mar 21, 2024

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
shinytest2-teal-widgets 👶 $+6.84$ $+2$ $0$ $0$ $+2$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
shinytest2-teal-widgets 👶 $+3.78$ e2e_teal.widgets_table_with_settings_is_initialized_with_two_buttons_and_a_table
shinytest2-teal-widgets 👶 $+3.06$ e2e_teal.widgets_verbatim_popup_is_initialized_with_a_button_that_opens_a_modal_with_a_verbatim_text

Results for commit d0b211b

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Mar 22, 2024

Unit Tests Summary

  1 files   30 suites   2m 53s ⏱️
240 tests 240 ✅ 0 💤 0 ❌
505 runs  505 ✅ 0 💤 0 ❌

Results for commit 9a23c3c.

♻️ This comment has been updated with latest results.

@averissimo averissimo self-assigned this Mar 22, 2024
tests/testthat/test-shinytest2-teal-widgets.R Outdated Show resolved Hide resolved
tests/testthat/test-shinytest2-teal-widgets.R Outdated Show resolved Hide resolved
tests/testthat/test-shinytest2-teal-widgets.R Outdated Show resolved Hide resolved
@m7pr
Copy link
Contributor Author

m7pr commented Mar 22, 2024

appreciate the review @averissimo - thanks!

gogonzo
gogonzo previously requested changes Apr 4, 2024
Copy link
Contributor

@gogonzo gogonzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These modules doesn't appear in teal. Please test where they appear

@m7pr
Copy link
Contributor Author

m7pr commented Apr 8, 2024

Hey @averissimo and @gogonzo I removed the tests and will upload them in {teal.widgets} repo.
@averissimo would you mind to approve, I have an extension on one of the methods in here?

@m7pr m7pr changed the title 503 shinytest2 for teal.widgets::table_with_settings and teal.widgets::verbatim_popup extend TealAppDriver$active_module_element() method with new hash parameter Apr 8, 2024
@m7pr
Copy link
Contributor Author

m7pr commented Apr 8, 2024

{teal.widgets} repo draft insightsengineering/teal.widgets#240

#'
#' @return (`string`) The active shiny name space of the component bound with the input `element`.
active_module_element = function(element) {
active_module_element = function(element, hash = TRUE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide use case where id is needed without a # prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's the app$get_value() that doesn't take #

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but teal.widgets don't use tealAppDriver so I think it isn't necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I've never experience a need to remove hash anywhere else in any other test

@gogonzo gogonzo dismissed their stale review April 11, 2024 05:01

suggestion acceptedapplie

Copy link
Contributor

@gogonzo gogonzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed as draft PR in teal.widgets doesn't need a TealAppDriver

@m7pr m7pr closed this Apr 17, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 2024
@m7pr m7pr deleted the teal.widgets@503-introduce-shinytest2@main branch May 7, 2024 08:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants